package com.igeek.shop.service.impl;

import java.sql.SQLException;
import java.util.Date;

import com.igeek.shop.dao.IUserDAO;
import com.igeek.shop.dao.impl.UserDAOImpl;
import com.igeek.shop.entity.User;
import com.igeek.shop.service.IUserService;
import com.igeek.utils.CommonUtils;

public class UserServiceImpl implements IUserService{

	@Override
	public int register(User user) 
	{
		IUserDAO dao = new UserDAOImpl();
		int result = 0;
		try {
			result = dao.insert(user);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return result;
	}
	public class UserService 
	{
	    
		@Override
		public boolean check(String username) 
		{
			IUserDAO dao = new UserDAOImpl();
			User user = null;
			try {
				user = dao.findByUsername(username);
			} catch (SQLException e) {
				e.printStackTrace();
			}
			return user==null;
		}

	}

}
